package cn.lml.lession.auth.config;

import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import com.google.common.collect.Lists;

@ConfigurationProperties(prefix = "auth.url")
@Component
public class AuthProperties {

    private List<String> methodGetUrl = Lists.newArrayList();
    private List<String> methodPostUrl = Lists.newArrayList();
    private String authLoginUrl="/login.html";
    private String authFailureUrl="";

    public List<String> getMethodGetUrl() {
        return methodGetUrl;
    }

    public void setMethodGetUrl(List<String> methodGetUrl) {
        this.methodGetUrl = methodGetUrl;
    }

    public List<String> getMethodPostUrl() {
        return methodPostUrl;
    }

    public void setMethodPostUrl(List<String> methodPostUrl) {
        this.methodPostUrl = methodPostUrl;
    }

    public String[] toGetAdapter(){
        if(methodGetUrl.size() > 0 ){
            String[] toBeStored = methodGetUrl.toArray(new String[methodGetUrl.size()]);
            return toBeStored;
        }
        return new String[]{};
    }
    public String[] toPostAdapter(){
        if(methodPostUrl.size() > 0 ){
            String[] toBeStored = methodPostUrl.toArray(new String[methodPostUrl.size()]);
            return toBeStored;
        }
        return new String[]{};
    }

	public String getAuthFailureUrl() {
		return authFailureUrl;
	}

	public void setAuthFailureUrl(String authFailureUrl) {
		this.authFailureUrl = authFailureUrl;
	}

	public String getAuthLoginUrl() {
		return authLoginUrl;
	}

	public void setAuthLoginUrl(String authLoginUrl) {
		this.authLoginUrl = authLoginUrl;
	}

	
}



